import Vue from 'vue';
import ElementUI from 'element-ui';
Vue.use(ElementUI)
import 'element-ui/lib/theme-chalk/index.css';
import jQuery from 'jquery'
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min';

import {moduleName} from './views/{name}.vue';
import routes from './views/routes';

routes.push({path:'/',component:routes[0].component});

Vue.config.debug = true; //开启错误提示

var router = new VueRouter({routes: routes});

// dom存在才实例化一个vue对象
var domExist = document.getElementById('{name}-app');
if (domExist) {
    new Vue({
        // el: document.getElementById('app'), 
        el: '#{name}-app', // 如果不渲染，那么久改为document.getElementById试下
        data: {},
        router: router
    });
}

export default {moduleName}; // 暴露组件